package cn.lzy.taskmanagement.AsyncNotResult;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WeiKaiYe
 * @CreateTime: 2023-10-21  17:26
 */

@RestController
public class MyAsyncController {

    @Autowired
    private MyAsyncService myService;

    //   http://localhost:8080/sendSMS

    @GetMapping("/sendSMS")
    public String sendSMS() throws Exception {
        Long startTime = System.currentTimeMillis();
        myService.sendSMS();
        Long endTime = System.currentTimeMillis();
        System.out.println("主流程耗时：  " + (endTime - startTime));
        return "success";
    }
}
